home *** CD-ROM | disk | FTP | other *** search
/ Workbench Design / WB Collection.iso / workbench werkzeuge / memory & system tools / vmm / doc / vmm_lib.doc < prev    next >
Text File  |  1996-04-07  |  5KB  |  166 lines

  1. TABLE OF CONTENTS
  2.  
  3. vmm.library/AllocVMem
  4. vmm.library/FreeVMem
  5. vmm.library/AvailVMem
  6. vmm.library/AllocVVec
  7. vmm.library/FreeVVec
  8. vmm.library/AllocVMem                                     vmm.library/AllocVMem
  9.  
  10.    NAME
  11.        AllocVMem - Allocate virtual memory
  12.  
  13.    SYNOPSIS
  14.        memoryblock = AllocVMem (bytesize, attributes)
  15.        D0                       D0        D1
  16.  
  17.        void *AllocVMem (ULONG,ULONG)
  18.  
  19.    FUNCTION
  20.        AllocVMem allocates virtual memory just the way AllocMem allocates
  21.        normal memory. 
  22.  
  23.    INPUTS
  24.     byteSize - the size of the desired block in bytes.  (The operating
  25.         system will automatically round this number to a multiple of
  26.         the system memory chunk size)
  27.  
  28.     attributes -
  29.         requirements
  30.  
  31.         MEMF_CLEAR:    The memory will be initialized to all
  32.                      zeros. This is the only attribute supported.
  33.  
  34.    RESULT
  35.     memoryBlock - a pointer to the newly allocated memory block.
  36.         If there are no free memory regions large enough to satisfy
  37.         the request, zero will be returned.  The pointer must be
  38.         checked for zero before the memory block may be used!
  39.         The memory block returned is long word aligned.
  40.  
  41.    WARNING
  42.     The result of any memory allocation MUST be checked, and a viable
  43.     error handling path taken.  ANY allocation may fail if memory has
  44.     been filled.
  45.  
  46.    NOTE
  47.     If the free list is corrupt, the system will panic with alert
  48.     AN_MemCorrupt, $01000005.
  49.  
  50.     This function may not be called from interrupts.
  51.  
  52.    SEE ALSO
  53.     FreeVMem
  54.  
  55. vmm.library/FreeVMem                                       vmm.library/FreeVMem
  56.  
  57.    NAME
  58.     FreeVMem -- deallocate virtual memory with knowledge
  59.  
  60.    SYNOPSIS
  61.     FreeVMem(memoryBlock, byteSize)
  62.               A1           D0
  63.  
  64.     void FreeVMem(void *,ULONG);
  65.  
  66.    FUNCTION
  67.     Free a region of virtual memory, returning it to the pool from which
  68.     it came.  Freeing partial blocks back into the pool is unwise.
  69.  
  70.    NOTE
  71.     If a block of memory is freed twice, the system will Guru. The
  72.     Alert is AN_FreeTwice ($01000009).   If you pass the wrong pointer,
  73.     you will probably see AN_MemCorrupt $01000005.
  74.  
  75.    INPUTS
  76.     memoryBlock - pointer to the memory block to free
  77.     byteSize - the size of the desired block in bytes.  (The operating
  78.         system will automatically round this number to a multiple of
  79.         the system memory chunk size)
  80.  
  81.    SEE ALSO
  82.     AllocVMem
  83.  
  84. vmm.library/AvailVMem                                    vmm.library/AvailVMem
  85.  
  86.    NAME
  87.     AvailVMem -- virtual memory available given certain requirements
  88.  
  89.    SYNOPSIS
  90.     size = AvailVMem(attributes)
  91.     D0               D1
  92.  
  93.     ULONG AvailVMem(ULONG);
  94.  
  95.    FUNCTION
  96.     This function returns the amount of free virtual memory given 
  97.      certain attributes.
  98.  
  99.     To find out what the largest block of a particular type is, add
  100.     MEMF_LARGEST into the requirements argument.  Returning the largest
  101.     block is a slow operation.
  102.  
  103.    WARNING
  104.     Due to the effect of multitasking, the value returned may not
  105.     actually be the amount of free memory available at that instant.
  106.  
  107.    INPUTS
  108.     requirements - The only valid flag is MEMF_LARGEST, which returns 
  109.                     the size of the largest block matching the 
  110.                     requirements.
  111.  
  112.    RESULT
  113.     size - total free space remaining (or the largest free block).
  114. vmm.library/AllocVVec                                  vmm.library/AllocVVec
  115.  
  116.    NAME
  117.     AllocVVec -- allocate virtual memory and keep track of the size
  118.  
  119.    SYNOPSIS
  120.     memoryBlock = AllocVVec(byteSize, attributes)
  121.     D0                      D0        D1
  122.  
  123.     void *AllocVVec(ULONG, ULONG);
  124.  
  125.    FUNCTION
  126.     This function works identically to AllocVMem(), but tracks the size
  127.     of the allocation.
  128.  
  129.     See the AllocVMem() documentation for details.
  130.  
  131.    WARNING
  132.     The result of any memory allocation MUST be checked, and a viable
  133.     error handling path taken.  ANY allocation may fail if memory has
  134.     been filled.
  135.  
  136.    SEE ALSO
  137.     FreeVVec, AllocVMem
  138.  
  139. vmm.library/FreeVVec                                     vmm.library/FreeVVec
  140.  
  141.    NAME
  142.     FreeVVec -- return AllocVVec() memory to the system  (V36)
  143.  
  144.    SYNOPSIS
  145.     FreeVVec(memoryBlock)
  146.               A1
  147.  
  148.     void FreeVVec(void *);
  149.  
  150.    FUNCTION
  151.     Free an allocation made by the AllocVVec() call.  The memory will
  152.     be returned to the system pool from which it came.
  153.  
  154.    NOTE
  155.     If a block of memory is freed twice, the system will Guru. The
  156.     Alert is AN_FreeTwice ($01000009).   If you pass the wrong pointer,
  157.     you will probably see AN_MemCorrupt $01000005.  Future versions may
  158.     add more sanity checks to the memory lists.
  159.  
  160.    INPUTS
  161.     memoryBlock - pointer to the memory block to free, or NULL.
  162.  
  163.    SEE ALSO
  164.     AllocVVec
  165.  
  166.